package pl.polsl.mmm.projectcomm.objects.MD5;

import java.io.Serializable;

import pl.polsl.mmm.projectcomm.data.vec3;
import pl.polsl.mmm.projectcomm.data.vec4;

/**
 * Created by Maciek on 2014-11-01.
 */
public class MD5Joint implements Serializable {
    private String  name;
    private int     parent;
    private vec3 location; //vec3
    private vec4 rotation; //vec4

    public MD5Joint() {
        location = new vec3();
        rotation = new vec4();
    }


    public MD5Joint(String name, int parent, vec3 location, vec4 rotation) {
        this.setName(name);
        this.setParent(parent);
        this.setLocation(location);
        this.setRotation(rotation);
    }

    public MD5Joint(MD5Joint copy) {
        this.name = copy.getName();
        this.parent = copy.getParent();
        this.location = copy.getLocation();
        this.rotation = copy.getRotation();
    }
    /*************************** GETTERY I SETTERY***************************/
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public vec3 getLocation() {
        return location;
    }

    public void setLocation(vec3 location) {
        this.location = location;
    }

    public vec4 getRotation() {
        return rotation;
    }

    public void setRotation(vec4 rotation) {
        this.rotation = rotation;
    }

    public void setRotation(vec3 rotation) {
        this.rotation = new vec4(rotation);
        this.rotation.buildW();
    }

    public int getParent() {
        return parent;
    }

    public void setParent(int parent) {
        this.parent = parent;
    }
}
